<?php 
/*
Template Name: Domácí stránka
*/
global $post;
$background = get_the_post_thumbnail_url();
get_header();

// check if the repeater field has rows of data

?>
<section class="wrapper" style="background: #fff url(<?php echo $background; ?>) no-repeat; background-size: 100% auto; background-size: cover;">
<div class="container">
	<div class="flex-container" style="margin-top: 250px;">
    	<?php
		if( have_rows('single_services_rep') ):
		    while ( have_rows('single_services_rep') ) : the_row();
		        $title = get_sub_field('service_title');
		        $content = get_sub_field('service_content');
		        $img = get_sub_field('service_img');
		        $thumb = $img['sizes'][ 'panoply-service-thumb' ];
		        $url = get_sub_field('service_url'); ?>

		    <div class="services-box">
		    	<a href="<?php echo $url; ?>"> 
			    	<h2><?php echo $title; ?></h2>
			    	<p><?php echo $content; ?></p>
			    	<img src="<?php echo $thumb; ?>" alt="<?php echo $img['alt']; ?>" />
			    	<p class="link-service">Více informací <span class="link-service fa"></span></p>
		    	</a>
		    </div>
		    <?php
		    endwhile;

		else :

		    // no rows found

		endif;

		?>
	</div>
	<?php get_template_part( 'inc/footer', 'contact' ); ?>
</div>

</section>

<?php get_footer('fp');?>